<?php /* Smarty version 2.6.18, created on 2009-04-23 10:01:18
         compiled from search.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'url', 'search.html', 44, false),array('function', 'webcontrol', 'search.html', 102, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="fnsoxt"/>
<link href="templates/css/search.css" type="text/css" rel="stylesheet" media="all" />
<title>VVdict</title>
<script language="javascript" type="text/javascript" src="templates/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="templates/js/word.js"></script>
<script language="javascript" type="text/javascript" src="templates/js/search.js"></script>
<script type='text/javascript' src='templates/js/jquery.bgiframe.min.js'></script>
<script type='text/javascript' src='templates/js/jquery.ajaxQueue.js'></script>
<script type='text/javascript' src='templates/js/thickbox-compressed.js'></script>
<script type='text/javascript' src='templates/js/jquery.autocomplete.pack.js'></script>
<script type='text/javascript' src='_Shared/_Cache/words.js'></script>
<link rel="stylesheet" type="text/css" href="templates/css/jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css" href="templates/css/thickbox.css" />
<script type="text/javascript">
$(function(){
	$("#keyword").autocomplete(words);
    if($('input#keyword').val()) {
        <!--$('input#keyword').focus();-->
        get_result($.trim($('input#keyword').val()));
    }
    else{
        window.location="index.php";
    }
    $("#search").click(function(){
        get_result($.trim($('input#keyword').val()));
    }); 
    $('input#keyword').keydown(function(event){
        if(event.keyCode==13 && $('input#keyword').focus()){
            if($('input#keyword').val()){
                get_result($.trim($('input#keyword').val()));
            }
            else{
                window.location="index.php";
            }
        }
    });
});
function get_result(form){
     $("#mean,#pic,#sentence").html("");
     $.getJSON("<?php echo $this->_plugins['function']['url'][0][0]->_pi_func_url(array('controller' => 'search','action' => 'mean'), $this);?>
",
        {word:form},
        function(data){
                var word = data.Word?data.Word:"该单词不存在";
                var str = "<p>"+word+str2img(data.YinBiao)+audio('?controller=word&action=voice&word='+word)+"</p><pre><p>"+data.HanYuJieshe+"</p></pre>";
                $("#mean").append(str);
        });
     $.getJSON("<?php echo $this->_plugins['function']['url'][0][0]->_pi_func_url(array('controller' => 'search','action' => 'image'), $this);?>
",
        {word:form},
        function(data){
            $.each(data, function(i,item){
                var str = "<div class='pic'><img alt='"+item.pic_text+"' src='?controller=search&action=showbysize&id="+item.pic_id+"'/><p>"+item.pic_text+audio('?controller=pic&action=voice&word='+item.Word+'&no='+item.No)+"</p><p>"+item.pic_text_zh+"</p></div>";
                $("#pic").append(str);
            });
        }); 
     $.getJSON("<?php echo $this->_plugins['function']['url'][0][0]->_pi_func_url(array('controller' => 'search','action' => 'sentence'), $this);?>
",
        {word:form},
        function(data){
            $.each(data, function(i,item){
                var str = "<ul><li>"+item.En_Sen+audio('?controller=sentence&action=voice&word='+item.Word+'&no='+item.No)+"</li><li>"+item.Chi_Sen+"</li></ul>";
                $("#sentence").append(str);
    }); });
}
function audio(c){
    var a;
	if(c!=""){
		a='<a href="javascript:return false;" onClick="ssplay(\''+c+'\');return false;" onMouseOver="ssplay(\''+c+'\')" onMouseOut="ssstop()"><img src="templates/images/audio.gif" border="0"></a>';
	}
	return a;
}
function getFlashMovieObject(movieName){
	if (window.document[movieName]){
		return window.document[movieName];
	}
	if(navigator.appName.indexOf("Microsoft Internet")==-1){
		if (document.embeds && document.embeds[movieName])
			return document.embeds[movieName];
	}
	else{
		return document.getElementById(movieName);
	}
}
function ssplay(c){
	var recite = getFlashMovieObject("recite");
	if(recite){
		recite.SetVariable("audio",c);
		recite.GotoFrame(1);
	}
}
function ssstop(){
	var recite = getFlashMovieObject("recite");
	if(recite){
		recite.GotoFrame(3);
	}
}
</script>
</head>
<body>
  <?php echo $this->_plugins['function']['webcontrol'][0][0]->_pi_func_webcontrol(array('type' => 'userstatus','name' => 'mystatus'), $this);?>

<div id="head">
    <a href="index.php"><img src="templates/images/logo_middle.png" alt="vvdict_logo" /></a>
    <input name="keyword" type="text" id="keyword" size="50" maxlength="60" value="<?php echo $this->_tpl_vars['word']; ?>
"/>
    <input id="search" type="button" value="查询" />
</div>
<div class="clear"></div>
<div id="status"></div>
<div id="content">
    <div id="mean"></div>
    <div id="pic"></div>
    <div id="sentence"></div>
</div>
<div class="clear"></div>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="0" height="0" id="recite" align="absmiddle"> 
    <param name="allowScriptAccess" value="always" /> 
    <param name="movie" value="templates/images/dict.swf" />
    <param name="quality" value="high" />
    <embed src="templates/images/dict.swf" quality="high" width="1" height="1" name="recite" align="absmiddle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> 
    </object>
    <object id="player" type="audio/mp3" data="" width="0" height="0">
      <param name="src" value="" />
      <param name="autostart" value="true" />
      <param name="controller" value="false" />
    </object>
  <?php echo $this->_plugins['function']['webcontrol'][0][0]->_pi_func_webcontrol(array('type' => 'footer','name' => 'myfooter'), $this);?>

</body>
</html>